package com.ruoyi.useragreement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.useragreement.mapper.UserAgreementMapper;
import com.ruoyi.useragreement.domain.Agreement;
import com.ruoyi.useragreement.service.AgreementService;

/**
 * 【用户协议】Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-02
 */
@Service
public class AgreementServiceImpl implements AgreementService
{
    @Autowired
    private UserAgreementMapper userAgreementMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param id 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public Agreement selectUserAgreementById(Long id)
    {
        return userAgreementMapper.selectUserAgreementById(id);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param userAgreement 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<Agreement> selectUserAgreementList(Agreement userAgreement)
    {
        return userAgreementMapper.selectUserAgreementList(userAgreement);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param userAgreement 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertUserAgreement(Agreement userAgreement)
    {
        userAgreement.setCreateTime(DateUtils.getNowDate());
        return userAgreementMapper.insertUserAgreement(userAgreement);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param userAgreement 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateUserAgreement(Agreement userAgreement)
    {
        userAgreement.setUpdateTime(DateUtils.getNowDate());
        return userAgreementMapper.updateUserAgreement(userAgreement);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param ids 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteUserAgreementByIds(Long[] ids)
    {
        return userAgreementMapper.deleteUserAgreementByIds(ids);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param id 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteUserAgreementById(Long id)
    {
        return userAgreementMapper.deleteUserAgreementById(id);
    }
}
